import { postAxios, getAxios } from '@/utils/http'
export const deviceApi = {

  changeStart: (data)=>{
    return getAxios('/device/change/start?isStart='+data.isStart+"&deviceId="+data.deviceId);
  },
  // 打开/关闭特征值开关
  changeOnFeature: (data)=>{
    return getAxios('/device/change/feature?isOn='+data.isOn+"&deviceId="+data.deviceId);
  },
  deleteDevice: (data)=>{
    return getAxios('/device/delete?deviceId='+data.deviceId);
  },
  // batchExport: (devicesList) => {
  //   return postDownloadAxios('/device/export/batch', devicesList);
  // },
  // 删除设备
  deleteDevices: (data) => {
    return postAxios('/device/batch/delete', data);
  },

  getDeviceList: (data) => {
    return postAxios('/device/list', data);
  },

  getDeviceAllList: () => {
    return getAxios('/device/all/list');
  },

  delTagList: (data) => {
    return postAxios('/device/delete/tag', data);
  },

  uploadDeviceTag: (data) => {
    return postAxios('/device/upload/tag', data);
  },

  getTagList: (deviceId) => {
    return getAxios('/device/tag/list?deviceId='+deviceId);
  },

  getOtherDevice: (strategyId) => {
    return getAxios('/strategy/other/devices?strategyId='+strategyId);
  },

  saveStrategyDevice: (data) => {
    return postAxios('/strategy/add/device/'+data.strategyId, data.deviceArray);
  },

  addDevice: (data) => {
    return postAxios('/device/add', data);
  },

  updateDevice: (data) => {
    return postAxios('/device/update', data);
  },

  // 批量禁用
  updateStatusBatch: (data) => {
    return postAxios('/employee/batchUpdateStatus', data);
  },
  // 单个员工角色授权
  updateRoles: (data) => {
    return postAxios('/employee/updateRoles', data);
  },
  // 修改密码
  updatePwd: (data) => {
    return postAxios('/user/updatePwd', data);
  },
  // 重置密码
  resetPassword: (employeeId) => {
    return getAxios('/employee/resetPasswd/' + employeeId);
  },
  // 通过部门id获取当前部门的人员&没有部门的人
  getListEmployeeByDeptId: (departmentId) => {
    return getAxios('/employee/listEmployeeByDeptId/' + departmentId);
  },
  // 删除员工
  deleteEmployee: (employeeId) => {
    return postAxios('/employee/delete/' + employeeId);
  }

};
